package com.kotiln.lgc.screenadapterlibrary;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.TextView;

import com.kotiln.lgc.screenadapterlibrary.method1.ViewCalculateUtil;

/**
 * 屏幕适配方式
 * 1,计算组件的宽高百分比
 *          //ViewCalculateUtil.setViewLinearLayoutParam(text1,1040,200,10,0,20,20);
 *         //ViewCalculateUtil.setViewLinearLayoutParam(text2,600,100,20,0,50,50);
 * 2,自定义布局组件在xml中使用 PercentRelativeLayout
 * 3,使用第三方AndroidAutoSize库
 *      3.1 app build.gradle文件中添加compile 'me.jessyan:autosize:1.0.1'
 *      3.2 <manifest>在app的manifest文件中配置如下属性
 *              <application>
 *                   <meta-data
 *                     android:name="design_width_in_dp"
 *                       android:value="360"/>
 *               <meta-data
 *                  android:name="design_height_in_dp"
 *                  android:value="640"/>
 *           </application>
 *          </manifest>
 */
public class MainActivity extends AppCompatActivity {
    TextView text1;
    TextView text2;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_third);
//        text1=findViewById(R.id.text1);
//        text2=findViewById(R.id.text2);
        //方式一
        //ViewCalculateUtil.setViewLinearLayoutParam(text1,1040,200,10,0,20,20);
        //ViewCalculateUtil.setViewLinearLayoutParam(text2,600,100,20,0,50,50);

    }
}